#pragma once

#include <cstddef>
#include "container_config.h"


class Container {
public:
    Container(ContainerConfig config);
    Container(const Container&) = delete;

    const Container& operator=(const Container&) = delete;

    void start();

    inline std::string_view getWorkDir() {return workDir;}

private:
    static constexpr std::size_t kStackSize = 65535;

    void limitProcessCreation();

    void set_cpu_limit(size_t cpu_shares);
    void set_memory_limit(size_t memory_limit);

    ContainerConfig conf;
    void* stackPtr;

    std::string workDir;
    std::string imageName;
};